ifndef ARCH
  ARCH = $(shell uname -m)
  ifeq ($(ARCH), x86_64)
    ARCH = x64
  else
    ARCH = x86
  endif
endif

CC = gcc
CCFLAGS = -g -Wall -fPIC 
ifeq ($(ARCH), x64)
  CCFLAGS += -m64
else
  ifeq ($(ARCH), x86)
    CCFLAGS += -m32
  endif
endif

DEFS = -DDEBUG

SRC = src/teste.c
	

		   
OBJ=$(SRC:.c=.o)
	
all: teste

teste: $(OBJ)
	$(CC) $(CCFLAGS) -o teste $(OBJ) $(LIB)
	
	    	
unknown:
	@echo "Unknown platform, stopping"

.c.o:
	$(CC) $(INCLUDES) $(CCFLAGS) $(DEFS) -c $< -o $*.o

clean:
	$(RM) $(OBJ) teste
